import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, IsEnum, IsDateString, IsUUID } from 'class-validator';
import { Priority, ProjectStatus } from '../../../types/enums';

export class UpdateProjectDto {
  @ApiProperty({
    description: '项目名称',
    example: '客户关系管理系统 - 升级版',
    required: false
  })
  @IsString({ message: '项目名称必须是字符串' })
  @IsOptional()
  name?: string;

  @ApiProperty({
    description: '项目描述',
    example: '一个用于管理客户关系和销售数据的系统，包含高级分析功能',
    required: false
  })
  @IsString({ message: '项目描述必须是字符串' })
  @IsOptional()
  description?: string;

  @ApiProperty({
    description: '项目开始日期',
    example: '2023-01-15',
    required: false
  })
  @IsDateString({}, { message: '开始日期必须是有效的日期字符串' })
  @IsOptional()
  startDate?: string;

  @ApiProperty({
    description: '项目结束日期',
    example: '2024-01-15',
    required: false
  })
  @IsDateString({}, { message: '结束日期必须是有效的日期字符串' })
  @IsOptional()
  endDate?: string;

  @ApiProperty({
    description: '项目状态',
    enum: ProjectStatus,
    example: ProjectStatus.ACTIVE,
    required: false
  })
  @IsEnum(ProjectStatus, { message: '项目状态必须是有效的枚举值' })
  @IsOptional()
  status?: ProjectStatus;

  @ApiProperty({
    description: '项目优先级',
    enum: Priority,
    example: Priority.HIGH,
    required: false
  })
  @IsEnum(Priority, { message: '项目优先级必须是有效的枚举值' })
  @IsOptional()
  priority?: Priority;
} 